package de.mmis.utilities.genericPublisher;

import de.mmis.core.base.infrastructure.PublishedDeviceDescription;
import de.mmis.core.pojop.NetworkPublisher.ServerType;
import de.mmis.core.pojop.server.Server;

public class POJOPPublishHandle extends PublishHandle {

	final ServerType type;
	final int port;

	final private Server server;

	public POJOPPublishHandle(String id, PublishedDeviceDescription descr,
			ServerType type, int port, Server server) {
		super(id, descr);
		this.type = type;
		this.port = port;
		this.server = server;
	}

	@Override
	public String toString() {
		return type + " on port " + port;
	}

	@Override
	protected String prettyStringImpl() {
		String result;

		result = "As " + type + "\n";
		result += "\tPort: " + port + "\n";

		return result;
	}

	/**
	 * @return the type
	 */
	public ServerType getType() {
		return type;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @return the {@link Server}
	 */
	Server getServer() {
		return server;
	}

}
